/**
 */
package org.mro.grib.model.files.secondEdition.grids.impl;

import java.nio.ByteBuffer;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.mro.grib.model.files.secondEdition.grids.GridDefinitionTemplate352;
import org.mro.grib.model.files.secondEdition.grids.GridsPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Grid Definition Template352</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.mro.grib.model.files.secondEdition.grids.impl.GridDefinitionTemplate352Impl#getLatitudeOfThePoleOfStretching <em>Latitude Of The Pole Of Stretching</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.grids.impl.GridDefinitionTemplate352Impl#getLongitudeOfThePoleOfStretching <em>Longitude Of The Pole Of Stretching</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.grids.impl.GridDefinitionTemplate352Impl#getStretchingFactor <em>Stretching Factor</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class GridDefinitionTemplate352Impl extends GridDefinitionTemplate350Impl implements GridDefinitionTemplate352 {
	/**
	 * The default value of the '{@link #getLatitudeOfThePoleOfStretching() <em>Latitude Of The Pole Of Stretching</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLatitudeOfThePoleOfStretching()
	 * @generated
	 * @ordered
	 */
	protected static final int LATITUDE_OF_THE_POLE_OF_STRETCHING_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getLatitudeOfThePoleOfStretching() <em>Latitude Of The Pole Of Stretching</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLatitudeOfThePoleOfStretching()
	 * @generated
	 * @ordered
	 */
	protected int latitudeOfThePoleOfStretching = LATITUDE_OF_THE_POLE_OF_STRETCHING_EDEFAULT;

	/**
	 * The default value of the '{@link #getLongitudeOfThePoleOfStretching() <em>Longitude Of The Pole Of Stretching</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLongitudeOfThePoleOfStretching()
	 * @generated
	 * @ordered
	 */
	protected static final int LONGITUDE_OF_THE_POLE_OF_STRETCHING_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getLongitudeOfThePoleOfStretching() <em>Longitude Of The Pole Of Stretching</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLongitudeOfThePoleOfStretching()
	 * @generated
	 * @ordered
	 */
	protected int longitudeOfThePoleOfStretching = LONGITUDE_OF_THE_POLE_OF_STRETCHING_EDEFAULT;

	/**
	 * The default value of the '{@link #getStretchingFactor() <em>Stretching Factor</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getStretchingFactor()
	 * @generated
	 * @ordered
	 */
	protected static final int STRETCHING_FACTOR_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getStretchingFactor() <em>Stretching Factor</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getStretchingFactor()
	 * @generated
	 * @ordered
	 */
	protected int stretchingFactor = STRETCHING_FACTOR_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected GridDefinitionTemplate352Impl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return GridsPackage.Literals.GRID_DEFINITION_TEMPLATE352;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getLatitudeOfThePoleOfStretching() {
		return latitudeOfThePoleOfStretching;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLatitudeOfThePoleOfStretching(int newLatitudeOfThePoleOfStretching) {
		int oldLatitudeOfThePoleOfStretching = latitudeOfThePoleOfStretching;
		latitudeOfThePoleOfStretching = newLatitudeOfThePoleOfStretching;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, GridsPackage.GRID_DEFINITION_TEMPLATE352__LATITUDE_OF_THE_POLE_OF_STRETCHING, oldLatitudeOfThePoleOfStretching, latitudeOfThePoleOfStretching));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getLongitudeOfThePoleOfStretching() {
		return longitudeOfThePoleOfStretching;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLongitudeOfThePoleOfStretching(int newLongitudeOfThePoleOfStretching) {
		int oldLongitudeOfThePoleOfStretching = longitudeOfThePoleOfStretching;
		longitudeOfThePoleOfStretching = newLongitudeOfThePoleOfStretching;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, GridsPackage.GRID_DEFINITION_TEMPLATE352__LONGITUDE_OF_THE_POLE_OF_STRETCHING, oldLongitudeOfThePoleOfStretching, longitudeOfThePoleOfStretching));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getStretchingFactor() {
		return stretchingFactor;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setStretchingFactor(int newStretchingFactor) {
		int oldStretchingFactor = stretchingFactor;
		stretchingFactor = newStretchingFactor;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, GridsPackage.GRID_DEFINITION_TEMPLATE352__STRETCHING_FACTOR, oldStretchingFactor, stretchingFactor));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case GridsPackage.GRID_DEFINITION_TEMPLATE352__LATITUDE_OF_THE_POLE_OF_STRETCHING:
				return getLatitudeOfThePoleOfStretching();
			case GridsPackage.GRID_DEFINITION_TEMPLATE352__LONGITUDE_OF_THE_POLE_OF_STRETCHING:
				return getLongitudeOfThePoleOfStretching();
			case GridsPackage.GRID_DEFINITION_TEMPLATE352__STRETCHING_FACTOR:
				return getStretchingFactor();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case GridsPackage.GRID_DEFINITION_TEMPLATE352__LATITUDE_OF_THE_POLE_OF_STRETCHING:
				setLatitudeOfThePoleOfStretching((Integer)newValue);
				return;
			case GridsPackage.GRID_DEFINITION_TEMPLATE352__LONGITUDE_OF_THE_POLE_OF_STRETCHING:
				setLongitudeOfThePoleOfStretching((Integer)newValue);
				return;
			case GridsPackage.GRID_DEFINITION_TEMPLATE352__STRETCHING_FACTOR:
				setStretchingFactor((Integer)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case GridsPackage.GRID_DEFINITION_TEMPLATE352__LATITUDE_OF_THE_POLE_OF_STRETCHING:
				setLatitudeOfThePoleOfStretching(LATITUDE_OF_THE_POLE_OF_STRETCHING_EDEFAULT);
				return;
			case GridsPackage.GRID_DEFINITION_TEMPLATE352__LONGITUDE_OF_THE_POLE_OF_STRETCHING:
				setLongitudeOfThePoleOfStretching(LONGITUDE_OF_THE_POLE_OF_STRETCHING_EDEFAULT);
				return;
			case GridsPackage.GRID_DEFINITION_TEMPLATE352__STRETCHING_FACTOR:
				setStretchingFactor(STRETCHING_FACTOR_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case GridsPackage.GRID_DEFINITION_TEMPLATE352__LATITUDE_OF_THE_POLE_OF_STRETCHING:
				return latitudeOfThePoleOfStretching != LATITUDE_OF_THE_POLE_OF_STRETCHING_EDEFAULT;
			case GridsPackage.GRID_DEFINITION_TEMPLATE352__LONGITUDE_OF_THE_POLE_OF_STRETCHING:
				return longitudeOfThePoleOfStretching != LONGITUDE_OF_THE_POLE_OF_STRETCHING_EDEFAULT;
			case GridsPackage.GRID_DEFINITION_TEMPLATE352__STRETCHING_FACTOR:
				return stretchingFactor != STRETCHING_FACTOR_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (latitudeOfThePoleOfStretching: "); //$NON-NLS-1$
		result.append(latitudeOfThePoleOfStretching);
		result.append(", longitudeOfThePoleOfStretching: "); //$NON-NLS-1$
		result.append(longitudeOfThePoleOfStretching);
		result.append(", stretchingFactor: "); //$NON-NLS-1$
		result.append(stretchingFactor);
		result.append(')');
		return result.toString();
	}

	/* (non-Javadoc)
	 * @see org.mro.grib.model.files.secondEdition.grids.impl.GridDefinitionTemplate350Impl#initialise(java.nio.ByteBuffer)
	 */
	@Override
	public void initialise(ByteBuffer buffer) {
		super.initialise(buffer);
		latitudeOfThePoleOfStretching = buffer.getInt();
		longitudeOfThePoleOfStretching = buffer.getInt();
		stretchingFactor = buffer.getInt();
	}
	
} //GridDefinitionTemplate352Impl
